<?php
//  This file is part of EkkinCMS.
//
//  EkkinCMS is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  EkkinCMS is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with EkkinCMS.  If not, see <http://www.gnu.org/licenses/>.


function execute_plugins($site_content){
    foreach (scandir("plugins") as $file){
        if (is_file("plugins/$file")){
            include_once("plugins/$file");
            $name = explode(".", $file);
            $ext = $name[1];
            $name = $name[0];

            if (count(explode("-", $name)) > 1){
                $a = explode("-", $name);
                $name = $a[1];
            }

            $function = "execute_$name";
            if ( $ext == "php" ) {
                $site_content = $function($site_content);
            }
            //$site_content = "execute_$name"($site_content);
        }
    }

    return $site_content;
}


?>
